package com.tierstall.shared;

public enum Page {
	LOGIN("login", UserType.GUEST, com.tierstall.client.view.LoginView.class),
	HOME("home", UserType.VIEWER, com.tierstall.client.view.main.ContentWidgetView.class),
	DB_FILTER("Filtere Suchergebnis", UserType.VIEWER, com.tierstall.client.view.content.CV_dbFilter.class),
	SEARCH_RESULT("Suchergebnis", UserType.VIEWER, com.tierstall.client.view.content.CV_searchResult.class),
	ADD_GROUP("Neue Gruppe", UserType.VIEWER, com.tierstall.client.view.content.CV_addGroup.class),
	ADD_TIER("Neues Tier", UserType.EDITOR, com.tierstall.client.view.content.CV_addTier.class),
	USER_LIST("User verwalten", UserType.ADMIN, com.tierstall.client.view.content.CV_showUsers.class),
	LIST("Liste", UserType.ADMIN, null),
	NOT_PERMITTED("Keine Berechtigung", UserType.GUEST, null);

	
	private String page;
	private UserType uType;
	@SuppressWarnings("rawtypes")
	private Class path;
	Page(String page, UserType type, Class path) {
		this.page = page;
		this.uType = type;
	}
	
	public String id(){
		return page;
	}
	
	public int getSecurityLevel(){
		return uType.getSecurityLevel();
	}
	
	public Class getClassPath(){
		return path;
	}
}
